import { Column, Entity, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { BaseEntity } from 'src/common/entities/base';
import { ApiProperty } from '@nestjs/swagger';

@Entity('edu_room', {
  comment: '教室表',
})
export class RoomEntity extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'room_id', comment: '教室ID' })
  public roomId: number;

  @ApiProperty({ description: '教室名称' })
  @Column({ type: 'varchar', name: 'room_name', length: 32, comment: '教室名称' })
  public roomName: string;

  @ApiProperty({ description: '教学楼' })
  @Column({ type: 'varchar', name: 'building', length: 64, comment: '教学楼' })
  public building: string;

  @ApiProperty({ description: '教室类型' })
  @Column({ type: 'char', length: 1, name: 'room_type', comment: '教室类型', default: '1' })
  public roomType: string;

  @ApiProperty({ description: '容纳人数' })
  @Column({ type: 'int', name: 'capacity', comment: '容纳人数' })
  public capacity: number;

  @ApiProperty({ description: '使用状态' })
  @Column({ type: 'char', length: 1, name: 'used_state', comment: '使用状态', default: '1' })
  public usedState: string;
}
